using ExampleMvcApplication.Controllers;
using ExampleMvcApplication.Models.Request;

namespace ExampleMvcApplication.Views.Account
{
    public class ChangePassword : Master<ChangePasswordRequest>
    {
        protected override string RenderTitleContent()
        {
            return "Change Password";
        }

        protected override string RenderMainContent(ChangePasswordRequest model)
        {
            return Children._(
                h2._("Change Password"),
                p._("Use the form below to change your password. "),
                p._("New passwords are required to be a minimum of ", model.MinPasswordLength, " characters in length."),
                RenderErrorSummary(),
                form.action(UrlResolver.UrlFor<AccountController>(x => x.ChangePassword(default(ChangePasswordRequest)))).method("post")._(
                    div._(
                        fieldset._(
                            legend._("Account Information"),
                            p._(
                                label._for("currentPassword")._("Current password:"),
                                input.type("password").name("currentPassword")
                                ),
                            p._(
                                label._for("newPassword")._("New password:"),
                                input.type("password").name("newPassword")
                                ),
                            p._(
                                label._for("confirmPassword")._("Confirm new password:"),
                                input.type("password").name("confirmPassword")
                                ),
                            p._(
                                input.type("submit").value("Register")
                                )
                            )
                        )
                    )
                );
        }
    }
}